package javaDemo02;

import java.util.ArrayList;

public class Commodity_list {//商品列表类

    public static void one1(ArrayList<Commodity> arr){
        System.out.println("---------------商品列表---------------");
        System.out.println("商品id\t\t" + "名 称\t\t\t" + "单 价\t\t\t" + "计量单位");
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i).getId() + "\t\t\t" + arr.get(i).getName() + "\t\t\t" + arr.get(i).getPrice() + "\t\t\t" + arr.get(i).getUnit() + "\t\t");

        }
        System.out.println("-------------------------------------");
    }

//    @Override
//    public String toString(int a) {
//        return arr.get(a).toString();
//    }
}
